package com.sharp.demo.vo.portal.relation;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.sharp.authorization.dao.common.entity.AcRole;
import com.sharp.portal.constant.anno.PortalField;
import com.sharp.portal.constant.anno.PortalId;
import com.sharp.portal.constant.anno.PortalModel;
import com.sharp.portal.constant.anno.PortalPid;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import java.util.Date;

/**
 * Title: AcUserVO
 * Description: Copyright: Copyright (c) 2019 Company: BHFAE
 *
 * @author Sharp
 * @date 2022/7/26 17:14
 */
@Data
@PortalModel(description = "角色", readOnly = false)
public class AcRoleVO extends AcRole {

    @PortalId
    @PortalField(required = true)
    private String id;

    @PortalPid
    @PortalField(required = true)
    private String parentRoleId;

    @PortalField(required = true)
    @ApiModelProperty(value = "角色名称")
    private String name;

    @PortalField(dataType = PortalField.DataType.DATE)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "创建时间")
    private Date createAt;

    @PortalField(dataType = PortalField.DataType.DATE)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "修改时间")
    private Date updateAt;

    /**
     * 有效性
     */
    @Column(name = "`valid`")
    @ApiModelProperty(value = "有效性")
    private String valid;


}
